# """
# libreoffice : doc->docx
# """
# import subprocess
#
# import pypandoc
#
#
# def convert_doc_to_docx(input_path,output_path):
#     subprocess.run([
#         "unoconv.bat",
#         "-f","docx",
#         "-o",output_path,
#         input_path
#     ])
#     return output_path
#
# """
# pandoc : docx->md
# """
#
# def convert_docx_to_md(input_file, output_file):
#     pypandoc.convert_file(
#         input_file,
#         'md',
#         format='docx',
#         outputfile=output_file
#     )
#     return output_file
#
# def read_text_by_convert(path, encoding=None, errors=None):
#     """
#     Open the file in text mode, read it, and close the file.
#     """
#     encoding = io.text_encoding(encoding)
#     if path.lower().endswith("doc"):
#         tmp = convert_doc_to_docx(path,"convert/tmp.docx")
#         fin = convert_docx_to_md(tmp,"convert/fin.md")
#     else:
#         fin = convert_docx_to_md(path, "convert/fin.md")
#
#     with open(fin,mode='r', encoding=encoding, errors=errors) as f:
#         return f.read()